# coding=utf-8
class Solution:
    def findMedianSortedArrays(self, nums1: list, nums2: list) -> float:
        if len(nums1) > len(nums2):
            for i in nums2:
                nums1.append(i)
            nums = nums1
        else:
            for i in nums1:
                nums2.append(i)
            nums = nums2
        nums.sort()
        nums = tuple(nums)
        if len(nums) % 2 == 0:
            f = nums[int(len(nums) / 2)]
            s = nums[int(len(nums) / 2) - 1]
            result = (f + s) / 2
        else:
            result = nums[int(len(nums) / 2)]
        return result


a = Solution()
a.findMedianSortedArrays([1, 2], [3, 4, 5])
